package com.sbtr.common.enums;

public enum CalculateEnum {

    custom("custom","自定义"),
    isEqual("isEqual","相等"),
    isNotEqual("isNotEqual","不相等"),
    isGreaterThan("isGreaterThan","大于"),
    isLessThan("isLessThan","小于"),
    isGreaterThanOrEqual("isGreaterThanOrEqual","大于等于"),
    isLessThanOrEqual("isLessThanOrEqual","小于等于"),
    round("round","保留小数"),
    getMax("getMax","最大值"),
    getMin("getMin","最小值"),
    getAverage("getAverage","平均值"),
    getMedian("getMedian","中位数"),
    getMode("getMode","众数"),
    range("range","极差"),
    variance("variance","方差"),
    calculateStatistics("calculateStatistics","统计信息数组"),
    standardDeviation("standardDeviation","标准差"),
    kurtosis("kurtosis","偏度"),
    skewness("skewness","偏度值"),
    normalizeMaxValue("normalizeMaxValue","最大值归一化"),
    normalizeMinMax("normalizeMinMax","最大最小值归一化"),
    zScoreNormalization("zScoreNormalization","正态分布"),
    centralization("centralization","中心化标准化"),
    isContain("isContain","包含"),
    isNoContain("isNoContain","不包含"),
    inStart("inStart","以开始"),
    inEnd("inEnd","以结束"),
    ;


    String code;
    String title;
    CalculateEnum(String code, String title){
        this.code=code;
        this.title=title;
    }

    public String getCodeByTitle(String title){
        CalculateEnum[] calculateEnums = values();
        for (CalculateEnum calculateEnum : calculateEnums) {
            if(calculateEnum.getTitle().equals(title)){
                return calculateEnum.getCode();
            }
        }
        return null;
    }
    public String getTitleByCode(String code){
        CalculateEnum[] calculateEnums = values();
        for (CalculateEnum calculateEnum : calculateEnums) {
            if(calculateEnum.getCode().equals(code)){
                return calculateEnum.getTitle();
            }
        }
        return null;
    }

    public String getCode(){
        return code;
    }
    public String getTitle(){
        return title;
    }

}
